/**
 * jims
 */
package com.jims.master.modules.med.entity;

import com.jims.master.common.persistence.DataEntity;
import com.jims.master.common.utils.IdGen;
import com.jims.master.modules.sys.utils.UserUtils;
import org.hibernate.validator.constraints.Length;

/**
 * 消费明细Entity
 * @author 陈晓阳
 * @version 2017-05-22
 */
public class MedicalCardConsumeDetail extends DataEntity<MedicalCardConsumeDetail> {
	
	private static final long serialVersionUID = 1L;
	private String masterId;		// master_id
	private double consumeMoney;		// 消费金额
	private String priceId;		// 价表Id
	private String itemName;		// 项目名称
	private double itemPrice;		// 单价
	private String itemClass;		// 类别
	private Integer amount;		// 数量
	private String expand1;		// expand1
	private String expand2;		// expand2
	private String expand3;		// expand3
//	private String orgId;		// 机构ID
    private String startTime;
    private String endTime;
    private String cardNo;
	public MedicalCardConsumeDetail() {
		super();
	}

	public MedicalCardConsumeDetail(String id){
		super(id);
	}

	@Length(min=1, max=64, message="master_id长度必须介于 1 和 64 之间")
	public String getMasterId() {
		return masterId;
	}

	public void setMasterId(String masterId) {
		this.masterId = masterId;
	}
	
	public double getConsumeMoney() {
		return consumeMoney;
	}

	public void setConsumeMoney(double consumeMoney) {
		this.consumeMoney = consumeMoney;
	}
	
	@Length(min=1, max=64, message="价表Id长度必须介于 1 和 64 之间")
	public String getPriceId() {
		return priceId;
	}

	public void setPriceId(String priceId) {
		this.priceId = priceId;
	}
	
	@Length(min=1, max=64, message="项目名称长度必须介于 1 和 64 之间")
	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	
	public double getItemPrice() {
		return itemPrice;
	}

	public void setItemPrice(double itemPrice) {
		this.itemPrice = itemPrice;
	}
	
	@Length(min=1, max=64, message="类别长度必须介于 1 和 64 之间")
	public String getItemClass() {
		return itemClass;
	}

	public void setItemClass(String itemClass) {
		this.itemClass = itemClass;
	}
	
	@Length(min=1, max=11, message="数量长度必须介于 1 和 11 之间")
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}
	
	@Length(min=0, max=64, message="expand1长度必须介于 0 和 64 之间")
	public String getExpand1() {
		return expand1;
	}

	public void setExpand1(String expand1) {
		this.expand1 = expand1;
	}
	
	@Length(min=0, max=64, message="expand2长度必须介于 0 和 64 之间")
	public String getExpand2() {
		return expand2;
	}

	public void setExpand2(String expand2) {
		this.expand2 = expand2;
	}
	
	@Length(min=0, max=64, message="expand3长度必须介于 0 和 64 之间")
	public String getExpand3() {
		return expand3;
	}

	public void setExpand3(String expand3) {
		this.expand3 = expand3;
	}

    public void setData(String masterId, double consumeMoney) {
        this.setIsNewRecord(true);
        this.setId(IdGen.uuid());
        this.setConsumeMoney(-consumeMoney);
        this.setRemarks("退费");
        this.setCreateDate(new java.util.Date());
        this.setCreateBy(UserUtils.getUser());
    }

//	@Length(min=1, max=64, message="机构ID长度必须介于 1 和 64 之间")
//	public String getOrgId() {
//		return orgId;
//	}
//
//	public void setOrgId(String orgId) {
//		this.orgId = orgId;
//	}

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
//
}